﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZK.Common
{
    public class BasicSetup : ConfigurationSection  
    {
        //[ConfigurationProperty("sysSetup", IsRequired = true)]
        //public MySysSetupElement SysSetup
        //{
        //    get { return (MySysSetupElement)this["sysSetup"]; }
        //}
        //public class MySysSetupElement : ConfigurationElement
        //{
        //    [ConfigurationProperty("transSaleType", IsRequired = true)]
        //    public int TransSaleType
        //    {
        //        get { return int.Parse(this["transSaleType"].ToString()); }
        //        set { this["transSaleType"] = value; }
        //    }

        //    [ConfigurationProperty("weighType", IsRequired = true)]
        //    public int WeighType
        //    {
        //        get { return int.Parse(this["weighType"].ToString()); }
        //        set { this["weighType"] = value; }
        //    }
        //}

        [ConfigurationProperty("customerInfo", IsRequired = true)]
        public MyCustomerInfoElement CustomerInfo
        {
            get { return (MyCustomerInfoElement)this["customerInfo"]; }
        }
        public class MyCustomerInfoElement : ConfigurationElement
        {
            [ConfigurationProperty("companyName")]
            public string CompanyName
            {
                get { return this["companyName"].ToString(); }
                set { this["companyName"] = value; }
            }

            [ConfigurationProperty("code")]
            public string Code
            {
                get { return this["code"].ToString(); }
                set { this["code"] = value; }
            }

            [ConfigurationProperty("id")]
            public string Id
            {
                get { return this["id"].ToString(); }
                set { this["id"] = value; }
            }
        }

        [ConfigurationProperty("userInfo", IsRequired = true)]
        public MyUserInfoElement UserInfo
        {
            get { return (MyUserInfoElement)this["userInfo"]; }
        }
        public class MyUserInfoElement : ConfigurationElement
        {
            [ConfigurationProperty("userName")]
            public string UserName
            {
                get { return this["userName"].ToString(); }
                set { this["userName"] = value; }
            }

            [ConfigurationProperty("userPwd")]
            public string UserPwd
            {
                get { return this["userPwd"].ToString(); }
                set { this["userPwd"] = value; }
            }

            [ConfigurationProperty("expiryTime")]
            public string ExpiryTime
            {
                get { return this["expiryTime"].ToString(); }
                set { this["expiryTime"] = value; }
            }
        }

        [ConfigurationProperty("weightScale", IsRequired = true)]
        public MyWeightScaleElement WeightScale
        {
            get { return (MyWeightScaleElement)this["weightScale"]; }
        }
        public class MyWeightScaleElement : ConfigurationElement
        {
            [ConfigurationProperty("name")]
            public string Name
            {
                get { return this["name"].ToString(); }
                set { this["name"] = value; }
            }

            [ConfigurationProperty("setupAddress")]
            public string SetupAddress
            {
                get { return this["setupAddress"].ToString(); }
                set { this["setupAddress"] = value; }
            }

            [ConfigurationProperty("identity")]
            public string Identity
            {
                get { return this["identity"].ToString(); }
                set { this["identity"] = value; }
            }

            [ConfigurationProperty("describe")]
            public string Describe
            {
                get { return this["describe"].ToString(); }
                set { this["describe"] = value; }
            }
        }

        [ConfigurationProperty("bunkerInfo", IsRequired = true)]
        public MyBunkerInfoElement BunkerInfo
        {
            get { return (MyBunkerInfoElement)this["bunkerInfo"]; }
        }
        public class MyBunkerInfoElement : ConfigurationElement
        {
            [ConfigurationProperty("bunkerId")]
            public string BunkerId
            {
                get { return this["bunkerId"].ToString(); }
                set { this["bunkerId"] = value; }
            }

            [ConfigurationProperty("bCode")]
            public string BCode
            {
                get { return this["bCode"].ToString(); }
                set { this["bCode"] = value; }
            }

            [ConfigurationProperty("bName")]
            public string BName
            {
                get { return this["bName"].ToString(); }
                set { this["bName"] = value; }
            }

            [ConfigurationProperty("addressId")]
            public string AddressId
            {
                get { return this["addressId"].ToString(); }
                set { this["addressId"] = value; }
            }

            [ConfigurationProperty("address")]
            public string Address
            {
                get { return this["address"].ToString(); }
                set { this["address"] = value; }
            }

            [ConfigurationProperty("coalId")]
            public string CoalId
            {
                get { return this["coalId"].ToString(); }
                set { this["coalId"] = value; }
            }

            [ConfigurationProperty("coalName")]
            public string CoalName
            {
                get { return this["coalName"].ToString(); }
                set { this["coalName"] = value; }
            }
        }
    }
}
